<div class="panel panel-default">
    <div class="panel-body">
        <img id="avatar" src="<?php echo $this->basePath() ?>/img/user/avatar/<?php echo $user->avatar ?>">
    </div>
</div>

<style>
    .panel-body {
        padding:2px;
        overflow-y: hidden;
    }
    .panel-body #avatar {
        width: 40px;
        height: 40px;
    }
</style>